
<!-- saved from url=(0035)http://lidongxuwork.gitee.io/error/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	  
    <title>i5ting_ztree_toc:报错总结</title>
		<link href="./index_files/github-bf51422f4bb36427d391e4b75a1daa083c2d840e.css" media="all" rel="stylesheet" type="text/css">
		<link href="./index_files/github2-d731afd4f624c99a4b19ad69f3083cd6d02b81d5.css" media="all" rel="stylesheet" type="text/css">
		<link href="./index_files/zTreeStyle.css" media="all" rel="stylesheet" type="text/css">
	  <style>
		pre {
		    counter-reset: line-numbering;
		    border: solid 1px #d9d9d9;
		    border-radius: 0;
		    background: #fff;
		    padding: 0;
		    line-height: 23px;
		    margin-bottom: 30px;
		    white-space: pre;
		    overflow-x: auto;
		    word-break: inherit;
		    word-wrap: inherit;
		}

		pre a::before {
		  content: counter(line-numbering);
		  counter-increment: line-numbering;
		  padding-right: 1em; /* space after numbers */
		  width: 25px;
		  text-align: right;
		  opacity: 0.7;
		  display: inline-block;
		  color: #aaa;
		  background: #eee;
		  margin-right: 16px;
		  padding: 2px 10px;
		  font-size: 13px;
		  -webkit-touch-callout: none;
		  -webkit-user-select: none;
		  -khtml-user-select: none;
		  -moz-user-select: none;
		  -ms-user-select: none;
		  user-select: none;
		}

		pre a:first-of-type::before {
		  padding-top: 10px;
		}

		pre a:last-of-type::before {
		  padding-bottom: 10px;
		}

		pre a:only-of-type::before {
		  padding: 10px;
		}

		.highlight { background-color: #ffffcc } /* RIGHT */
		</style>
  </head>
  <body>
	  <div>
				<div style="width:25%;">
						<ul id="tree" class="ztree" style="width: 326px; overflow: auto; position: fixed; z-index: 2147483647; border: 0px none; left: 0px; top: 0px; height: 746px;"><li id="tree_1" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_1_switch" title="" class="button level0 switch roots_docu" treenode_switch=""></span><a id="tree_1_a" class="level0 curSelectedNode" treenode_a="" onclick="" target="_blank" style="" title="Table of Content"><span id="tree_1_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_1_span">Table of Content</span></a></li><li id="tree_2" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_2_switch" title="" class="button level0 switch center_close" treenode_switch=""></span><a id="tree_2_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#1" target="_self" style="" title="1. JS语法"><span id="tree_2_ico" title="" treenode_ico="" class="button ico_close" style="width:0px;height:0px;"></span><span id="tree_2_span">1. JS语法</span></a><ul id="tree_2_ul" class="level0 line" style="display: none; overflow: hidden;"><li id="tree_3" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_3_switch" title="" class="button level1 switch center_open" treenode_switch=""></span><a id="tree_3_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#101" target="_self" style="" title="1.1. JS基础"><span id="tree_3_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_3_span">1.1. JS基础</span></a><ul id="tree_3_ul" class="level1 line" style="display:block"><li id="tree_4" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_4_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_4_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10101" target="_self" style="" title="1.1.1. 报错: xxx is not defined"><span id="tree_4_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_4_span">1.1.1. 报错: xxx is not defined</span></a></li><li id="tree_5" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_5_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_5_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10102" target="_self" style="" title="1.1.2. 问题: Cannot read property &#39;forEach&#39; of undefined"><span id="tree_5_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_5_span">1.1.2. 问题: Cannot read property 'forEach' of undefined</span></a></li><li id="tree_6" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_6_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_6_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10103" target="_self" style="" title="1.1.3. 问题: xxx.foreach is not a function"><span id="tree_6_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_6_span">1.1.3. 问题: xxx.foreach is not a function</span></a></li><li id="tree_7" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_7_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_7_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10104" target="_self" style="" title="1.1.4. 报错: Failed to execute &#39;append&#39; on &#39;FormData&#39;: 2 arguments required, but only 1 present."><span id="tree_7_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_7_span">1.1.4. 报错: Failed to execute 'append' on 'FormData': 2 arguments required, but only 1 present.</span></a></li></ul></li><li id="tree_8" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_8_switch" title="" class="button level1 switch center_open" treenode_switch=""></span><a id="tree_8_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#102" target="_self" style="" title="1.2. JS高级"><span id="tree_8_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_8_span">1.2. JS高级</span></a><ul id="tree_8_ul" class="level1 line" style="display:block"><li id="tree_9" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_9_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_9_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10201" target="_self" style="" title="1.2.1. 报错：Must call super constructor ..."><span id="tree_9_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_9_span">1.2.1. 报错：Must call super constructor ...</span></a></li><li id="tree_10" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_10_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_10_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10202" target="_self" style="" title="1.2.2. 逻辑: 在constructor里返回的不是实例对象"><span id="tree_10_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_10_span">1.2.2. 逻辑: 在constructor里返回的不是实例对象</span></a></li></ul></li><li id="tree_11" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_11_switch" title="" class="button level1 switch bottom_open" treenode_switch=""></span><a id="tree_11_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#103" target="_self" style="" title="1.3. jQ"><span id="tree_11_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_11_span">1.3. jQ</span></a><ul id="tree_11_ul" class="level1 " style="display:block"><li id="tree_12" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_12_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_12_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10301" target="_self" style="" title="1.3.1. 报错: Cannot read property 0 of undefined"><span id="tree_12_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_12_span">1.3.1. 报错: Cannot read property 0 of undefined</span></a></li><li id="tree_13" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_13_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_13_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#10302" target="_self" style="" title="1.3.2. 问题: 点击按钮 - 无反应"><span id="tree_13_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_13_span">1.3.2. 问题: 点击按钮 - 无反应</span></a></li></ul></li></ul></li><li id="tree_14" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_14_switch" title="" class="button level0 switch center_open" treenode_switch=""></span><a id="tree_14_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#2" target="_self" style="" title="2. 网络编程"><span id="tree_14_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_14_span">2. 网络编程</span></a><ul id="tree_14_ul" class="level0 line" style="display:block"><li id="tree_15" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_15_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_15_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#201" target="_self" style="" title="2.1. 报错: net::ERR_INTERNET_DISCONNECTED"><span id="tree_15_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_15_span">2.1. 报错: net::ERR_INTERNET_DISCONNECTED</span></a></li><li id="tree_16" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_16_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_16_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#202" target="_self" style="" title="2.2. 报错: 只要见到timeout"><span id="tree_16_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_16_span">2.2. 报错: 只要见到timeout</span></a></li><li id="tree_17" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_17_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_17_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#203" target="_self" style="" title="2.3. 报错: 404 (Not Found)"><span id="tree_17_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_17_span">2.3. 报错: 404 (Not Found)</span></a></li><li id="tree_18" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_18_switch" title="" class="button level1 switch bottom_docu" treenode_switch=""></span><a id="tree_18_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#204" target="_self" style="" title="2.4. 报错: Access to XMLHttpRequest"><span id="tree_18_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_18_span">2.4. 报错: Access to XMLHttpRequest</span></a></li></ul></li><li id="tree_19" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_19_switch" title="" class="button level0 switch center_open" treenode_switch=""></span><a id="tree_19_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#3" target="_self" style="" title="3. vscode相关插件"><span id="tree_19_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_19_span">3. vscode相关插件</span></a><ul id="tree_19_ul" class="level0 line" style="display:block"><li id="tree_20" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_20_switch" title="" class="button level1 switch bottom_docu" treenode_switch=""></span><a id="tree_20_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#301" target="_self" style="" title="3.1. 问题: vscode插件 - post请求不发送"><span id="tree_20_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_20_span">3.1. 问题: vscode插件 - post请求不发送</span></a></li></ul></li><li id="tree_21" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_21_switch" title="" class="button level0 switch center_open" treenode_switch=""></span><a id="tree_21_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#4" target="_self" style="" title="4. git"><span id="tree_21_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_21_span">4. git</span></a><ul id="tree_21_ul" class="level0 line" style="display:block"><li id="tree_22" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_22_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_22_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#401" target="_self" style="" title="4.1. 问题: not a git repository"><span id="tree_22_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_22_span">4.1. 问题: not a git repository</span></a></li><li id="tree_23" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_23_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_23_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#402" target="_self" style="" title="4.2. 问题: failed to push some refs to &#39;xxxxx&#39;"><span id="tree_23_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_23_span">4.2. 问题: failed to push some refs to 'xxxxx'</span></a></li><li id="tree_24" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_24_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_24_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#403" target="_self" style="" title="4.3. 问题: Access deined You do not have premission push to this repository"><span id="tree_24_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_24_span">4.3. 问题: Access deined You do not have premission push to this repository</span></a></li><li id="tree_25" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_25_switch" title="" class="button level1 switch bottom_docu" treenode_switch=""></span><a id="tree_25_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#404" target="_self" style="" title="4.4. 问题: Repository Not Found"><span id="tree_25_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_25_span">4.4. 问题: Repository Not Found</span></a></li></ul></li><li id="tree_26" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_26_switch" title="" class="button level0 switch center_open" treenode_switch=""></span><a id="tree_26_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#5" target="_self" style="" title="5. 大事件项目"><span id="tree_26_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_26_span">5. 大事件项目</span></a><ul id="tree_26_ul" class="level0 line" style="display:block"><li id="tree_27" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_27_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_27_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#501" target="_self" style="" title="5.1. 问题: 表单提交 - 无反应"><span id="tree_27_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_27_span">5.1. 问题: 表单提交 - 无反应</span></a></li><li id="tree_28" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_28_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_28_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#502" target="_self" style="" title="5.2. 问题: 提示 - 用户名/密码 undefined"><span id="tree_28_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_28_span">5.2. 问题: 提示 - 用户名/密码 undefined</span></a></li><li id="tree_29" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_29_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_29_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#503" target="_self" style="" title="5.3. 问题: 验证规则不生效"><span id="tree_29_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_29_span">5.3. 问题: 验证规则不生效</span></a></li><li id="tree_30" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_30_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_30_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#504" target="_self" style="" title="5.4. 问题: 后台返回400"><span id="tree_30_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_30_span">5.4. 问题: 后台返回400</span></a></li><li id="tree_31" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_31_switch" title="" class="button level1 switch bottom_docu" treenode_switch=""></span><a id="tree_31_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#505" target="_self" style="" title="5.5. 问题: 上传头像没反应"><span id="tree_31_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_31_span">5.5. 问题: 上传头像没反应</span></a></li></ul></li><li id="tree_32" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_32_switch" title="" class="button level0 switch center_open" treenode_switch=""></span><a id="tree_32_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#6" target="_self" style="" title="6. SQL相关"><span id="tree_32_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_32_span">6. SQL相关</span></a><ul id="tree_32_ul" class="level0 line" style="display:block"><li id="tree_33" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_33_switch" title="" class="button level1 switch bottom_docu" treenode_switch=""></span><a id="tree_33_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#601" target="_self" style="" title="6.1. 解决ID不连续问题"><span id="tree_33_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_33_span">6.1. 解决ID不连续问题</span></a></li></ul></li><li id="tree_34" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_34_switch" title="" class="button level0 switch center_open" treenode_switch=""></span><a id="tree_34_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#7" target="_self" style="" title="7. Node"><span id="tree_34_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_34_span">7. Node</span></a><ul id="tree_34_ul" class="level0 line" style="display:block"><li id="tree_35" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_35_switch" title="" class="button level1 switch center_open" treenode_switch=""></span><a id="tree_35_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#701" target="_self" style="" title="7.1. node相关"><span id="tree_35_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_35_span">7.1. node相关</span></a><ul id="tree_35_ul" class="level1 line" style="display:block"><li id="tree_36" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_36_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_36_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490101" target="_self" style="" title="7.1.1. 问题: 安装弹窗error 2503"><span id="tree_36_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_36_span">7.1.1. 问题: 安装弹窗error 2503</span></a></li></ul></li><li id="tree_37" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_37_switch" title="" class="button level1 switch center_open" treenode_switch=""></span><a id="tree_37_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#702" target="_self" style="" title="7.2. npm相关"><span id="tree_37_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_37_span">7.2. npm相关</span></a><ul id="tree_37_ul" class="level1 line" style="display:block"><li id="tree_38" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_38_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_38_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490201" target="_self" style="" title="7.2.1. 报错: 无法识别为可运行程序的名称"><span id="tree_38_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_38_span">7.2.1. 报错: 无法识别为可运行程序的名称</span></a></li><li id="tree_39" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_39_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_39_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490202" target="_self" style="" title="7.2.2. 报错: 403 You cannot publish over the previously published versions:1.0.0"><span id="tree_39_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_39_span">7.2.2. 报错: 403 You cannot publish over the previously published versions:1.0.0</span></a></li><li id="tree_40" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_40_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_40_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490203" target="_self" style="" title="7.2.3. 报错: 400 &quot;xxx&quot; is invalid for new packages"><span id="tree_40_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_40_span">7.2.3. 报错: 400 "xxx" is invalid for new packages</span></a></li><li id="tree_41" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_41_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_41_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490204" target="_self" style="" title="7.2.4. 报错: 403 Package name triggered spam detection"><span id="tree_41_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_41_span">7.2.4. 报错: 403 Package name triggered spam detection</span></a></li><li id="tree_42" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_42_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_42_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490205" target="_self" style="" title="7.2.5. 问题: 网页 Too Many Request"><span id="tree_42_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_42_span">7.2.5. 问题: 网页 Too Many Request</span></a></li><li id="tree_43" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_43_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_43_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490206" target="_self" style="" title="7.2.6. 报错: operation not permitted"><span id="tree_43_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_43_span">7.2.6. 报错: operation not permitted</span></a></li><li id="tree_44" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_44_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_44_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490207" target="_self" style="" title="7.2.7. 报错: 403 tors can unpublish module"><span id="tree_44_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_44_span">7.2.7. 报错: 403 tors can unpublish module</span></a></li><li id="tree_45" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_45_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_45_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490208" target="_self" style="" title="7.2.8. 报错: 502 Bad Gateway"><span id="tree_45_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_45_span">7.2.8. 报错: 502 Bad Gateway</span></a></li><li id="tree_46" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_46_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_46_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490209" target="_self" style="" title="7.2.9. 报错: this is a problem related to network connectivity"><span id="tree_46_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_46_span">7.2.9. 报错: this is a problem related to network connectivity</span></a></li><li id="tree_47" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_47_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_47_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490210" target="_self" style="" title="7.2.10. 报错: xxxx不是内部或外部命令"><span id="tree_47_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_47_span">7.2.10. 报错: xxxx不是内部或外部命令</span></a></li><li id="tree_48" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_48_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_48_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#490211" target="_self" style="" title="7.2.11. 报错: 403"><span id="tree_48_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_48_span">7.2.11. 报错: 403</span></a></li></ul></li><li id="tree_49" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_49_switch" title="" class="button level1 switch bottom_docu" treenode_switch=""></span><a id="tree_49_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#703" target="_self" style="" title="7.3. express相关"><span id="tree_49_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_49_span">7.3. express相关</span></a></li></ul></li><li id="tree_50" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_50_switch" title="" class="button level0 switch center_close" treenode_switch=""></span><a id="tree_50_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#8" target="_self" style="" title="8. webpack"><span id="tree_50_ico" title="" treenode_ico="" class="button ico_close" style="width:0px;height:0px;"></span><span id="tree_50_span">8. webpack</span></a><ul id="tree_50_ul" class="level0 line" style="display: none; overflow: hidden;"><li id="tree_51" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_51_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_51_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#801" target="_self" style="" title="8.1. 报错：An unexpected error occurred"><span id="tree_51_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_51_span">8.1. 报错：An unexpected error occurred</span></a></li><li id="tree_52" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_52_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_52_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#802" target="_self" style="" title="8.2. 报错：Unknown command or entry"><span id="tree_52_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_52_span">8.2. 报错：Unknown command or entry</span></a></li><li id="tree_53" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_53_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_53_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#803" target="_self" style="" title="8.3. 报错：Cannot find module xxx"><span id="tree_53_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_53_span">8.3. 报错：Cannot find module xxx</span></a></li><li id="tree_54" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_54_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_54_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#804" target="_self" style="" title="8.4. 报错：Cannot resolve vue"><span id="tree_54_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_54_span">8.4. 报错：Cannot resolve vue</span></a></li><li id="tree_55" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_55_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_55_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#805" target="_self" style="" title="8.5. 报错：Invalid package name"><span id="tree_55_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_55_span">8.5. 报错：Invalid package name</span></a></li><li id="tree_56" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_56_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_56_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#806" target="_self" style="" title="8.6. 报错：Can`t resolve xxx"><span id="tree_56_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_56_span">8.6. 报错：Can`t resolve xxx</span></a></li><li id="tree_57" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_57_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_57_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#807" target="_self" style="" title="8.7. 报错：无法将&quot;yarn&quot;识别为  cmdlet"><span id="tree_57_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_57_span">8.7. 报错：无法将"yarn"识别为  cmdlet</span></a></li><li id="tree_58" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_58_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_58_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#808" target="_self" style="" title="8.8. 报错：The engine &quot;node&quot; is incompatible"><span id="tree_58_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_58_span">8.8. 报错：The engine "node" is incompatible</span></a></li><li id="tree_59" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_59_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_59_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#809" target="_self" style="" title="8.9. 报错：webpack不是内部或外部命令"><span id="tree_59_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_59_span">8.9. 报错：webpack不是内部或外部命令</span></a></li><li id="tree_60" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_60_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_60_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810" target="_self" style="" title="8.10. 报错：Couldn&#39;t find a package.json file"><span id="tree_60_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_60_span">8.10. 报错：Couldn't find a package.json file</span></a></li><li id="tree_61" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_61_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_61_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#811" target="_self" style="" title="8.11. 报错：yarn 不是内部或外部命令"><span id="tree_61_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_61_span">8.11. 报错：yarn 不是内部或外部命令</span></a></li><li id="tree_62" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_62_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_62_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#812" target="_self" style="" title="8.12. 报错: 系统找不到指令路径"><span id="tree_62_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_62_span">8.12. 报错: 系统找不到指令路径</span></a></li><li id="tree_63" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_63_switch" title="" class="button level1 switch center_docu" treenode_switch=""></span><a id="tree_63_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#813" target="_self" style="" title="8.13. 报错: in ./public/index.html"><span id="tree_63_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_63_span">8.13. 报错: in ./public/index.html</span></a></li><li id="tree_64" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_64_switch" title="" class="button level1 switch bottom_docu" treenode_switch=""></span><a id="tree_64_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#814" target="_self" style="" title="8.14. 报错: Command &quot;xxx&quot; not found"><span id="tree_64_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_64_span">8.14. 报错: Command "xxx" not found</span></a></li></ul></li><li id="tree_65" class="level0" tabindex="0" hidefocus="true" treenode=""><span id="tree_65_switch" title="" class="button level0 switch bottom_close" treenode_switch=""></span><a id="tree_65_a" class="level0" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#9" target="_self" style="" title="9. Vue基础"><span id="tree_65_ico" title="" treenode_ico="" class="button ico_close" style="width:0px;height:0px;"></span><span id="tree_65_span">9. Vue基础</span></a><ul id="tree_65_ul" class="level0 " style="display: none; overflow: hidden;"><li id="tree_66" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_66_switch" title="" class="button level1 switch center_open" treenode_switch=""></span><a id="tree_66_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#901" target="_self" style="" title="9.1. JS语法类错误"><span id="tree_66_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_66_span">9.1. JS语法类错误</span></a><ul id="tree_66_ul" class="level1 line" style="display:block"><li id="tree_67" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_67_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_67_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810101" target="_self" style="" title="9.1.1. 报错：xx is not defined"><span id="tree_67_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_67_span">9.1.1. 报错：xx is not defined</span></a></li></ul></li><li id="tree_68" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_68_switch" title="" class="button level1 switch center_open" treenode_switch=""></span><a id="tree_68_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#902" target="_self" style="" title="9.2. Vue框架规则类错误"><span id="tree_68_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_68_span">9.2. Vue框架规则类错误</span></a><ul id="tree_68_ul" class="level1 line" style="display:block"><li id="tree_69" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_69_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_69_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810201" target="_self" style="" title="9.2.1. 报错: Vue is not defined"><span id="tree_69_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_69_span">9.2.1. 报错: Vue is not defined</span></a></li><li id="tree_70" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_70_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_70_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810202" target="_self" style="" title="9.2.2. 问题: 不解析内容"><span id="tree_70_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_70_span">9.2.2. 问题: 不解析内容</span></a></li><li id="tree_71" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_71_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_71_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810203" target="_self" style="" title="9.2.3. 报错: Do not mount Vue to &lt;html&gt;"><span id="tree_71_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_71_span">9.2.3. 报错: Do not mount Vue to &lt;html&gt;</span></a></li><li id="tree_72" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_72_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_72_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810204" target="_self" style="" title="9.2.4. 报错: Property or method &#39;xxx&#39; is not defined on the instance"><span id="tree_72_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_72_span">9.2.4. 报错: Property or method 'xxx' is not defined on the instance</span></a></li><li id="tree_73" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_73_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_73_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810205" target="_self" style="" title="9.2.5. 报错: method &#39;name&#39; has already been defined as a"><span id="tree_73_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_73_span">9.2.5. 报错: method 'name' has already been defined as a</span></a></li><li id="tree_74" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_74_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_74_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810206" target="_self" style="" title="9.2.6. 报错: the data property &#39;name&#39; is already defined"><span id="tree_74_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_74_span">9.2.6. 报错: the data property 'name' is already defined</span></a></li><li id="tree_75" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_75_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_75_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810207" target="_self" style="" title="9.2.7. 报错: Duplicate keys detected"><span id="tree_75_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_75_span">9.2.7. 报错: Duplicate keys detected</span></a></li><li id="tree_76" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_76_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_76_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810208" target="_self" style="" title="9.2.8. 报错: the data option should be a function"><span id="tree_76_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_76_span">9.2.8. 报错: the data option should be a function</span></a></li><li id="tree_77" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_77_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_77_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810209" target="_self" style="" title="9.2.9. 报错: Component template should contain exactly one root element"><span id="tree_77_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_77_span">9.2.9. 报错: Component template should contain exactly one root element</span></a></li><li id="tree_78" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_78_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_78_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810210" target="_self" style="" title="9.2.10. 报错: do not use build-in or reserved HTML elements as"><span id="tree_78_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_78_span">9.2.10. 报错: do not use build-in or reserved HTML elements as</span></a></li><li id="tree_79" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_79_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_79_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810211" target="_self" style="" title="9.2.11. 报错: Unknown custom element"><span id="tree_79_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_79_span">9.2.11. 报错: Unknown custom element</span></a></li><li id="tree_80" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_80_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_80_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810212" target="_self" style="" title="9.2.12. 报错: Failed to mount component: template or render function not defined"><span id="tree_80_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_80_span">9.2.12. 报错: Failed to mount component: template or render function not defined</span></a></li><li id="tree_81" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_81_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_81_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810213" target="_self" style="" title="9.2.13. 报错: Avoid mutating a prop directly since the value will be overwritten"><span id="tree_81_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_81_span">9.2.13. 报错: Avoid mutating a prop directly since the value will be overwritten</span></a></li><li id="tree_82" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_82_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_82_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810214" target="_self" style="" title="9.2.14. 报错: Computed property &quot;xxx&quot; was assigned to but it has no setter"><span id="tree_82_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_82_span">9.2.14. 报错: Computed property "xxx" was assigned to but it has no setter</span></a></li><li id="tree_83" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_83_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_83_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810215" target="_self" style="" title="9.2.15. 报错: avoid using JavaScript unary operator as property name"><span id="tree_83_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_83_span">9.2.15. 报错: avoid using JavaScript unary operator as property name</span></a></li><li id="tree_84" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_84_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_84_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810216" target="_self" style="" title="9.2.16. 报错: Templates should only be responseible for mapping the state to the UI"><span id="tree_84_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_84_span">9.2.16. 报错: Templates should only be responseible for mapping the state to the UI</span></a></li></ul></li><li id="tree_85" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_85_switch" title="" class="button level1 switch center_open" treenode_switch=""></span><a id="tree_85_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#903" target="_self" style="" title="9.3. 拼写类错误"><span id="tree_85_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_85_span">9.3. 拼写类错误</span></a><ul id="tree_85_ul" class="level1 line" style="display:block"><li id="tree_86" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_86_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_86_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810301" target="_self" style="" title="9.3.1. 报错: Error in mounted hook: &quot;TypeError: xxx is not a function&quot;"><span id="tree_86_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_86_span">9.3.1. 报错: Error in mounted hook: "TypeError: xxx is not a function"</span></a></li></ul></li><li id="tree_87" class="level1" tabindex="0" hidefocus="true" treenode=""><span id="tree_87_switch" title="" class="button level1 switch bottom_open" treenode_switch=""></span><a id="tree_87_a" class="level1" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#904" target="_self" style="" title="9.4. 其他错误"><span id="tree_87_ico" title="" treenode_ico="" class="button ico_open" style="width:0px;height:0px;"></span><span id="tree_87_span">9.4. 其他错误</span></a><ul id="tree_87_ul" class="level1 " style="display:block"><li id="tree_88" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_88_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_88_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810401" target="_self" style="" title="9.4.1. 报错: this.getOptions is not a function"><span id="tree_88_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_88_span">9.4.1. 报错: this.getOptions is not a function</span></a></li><li id="tree_89" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_89_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_89_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810402" target="_self" style="" title="9.4.2. 报错: this dependency was not found"><span id="tree_89_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_89_span">9.4.2. 报错: this dependency was not found</span></a></li><li id="tree_90" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_90_switch" title="" class="button level2 switch center_docu" treenode_switch=""></span><a id="tree_90_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810403" target="_self" style="" title="9.4.3. 报错: spawn cmd ENOENT"><span id="tree_90_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_90_span">9.4.3. 报错: spawn cmd ENOENT</span></a></li><li id="tree_91" class="level2" tabindex="0" hidefocus="true" treenode=""><span id="tree_91_switch" title="" class="button level2 switch bottom_docu" treenode_switch=""></span><a id="tree_91_a" class="level2" treenode_a="" onclick="" href="http://lidongxuwork.gitee.io/error/#810404" target="_self" style="" title="9.4.4. 报错: Invalild options in vue.config.js"><span id="tree_91_ico" title="" treenode_ico="" class="button ico_docu" style="width:0px;height:0px;"></span><span id="tree_91_span">9.4.4. 报错: Invalild options in vue.config.js</span></a></li></ul></li></ul></li></ul>
				</div>
        <div id="readme" style="width: 70%; margin-left: 25%;">
          	<article class="markdown-body">
            	<h1 id="1">1. JS语法</h1>
<h2 id="101">1.1. JS基础</h2>
<h3 id="10101">1.1.1. 报错: xxx is not defined</h3>
<p>错误描述: 什么xxx变量未定义</p>
<ul>
<li><p>有问题代码:</p>
<pre><code class="lang-js">var arr = [1, 5, 3, 2, 10];
Arr.push(100);
</code></pre>
</li>
<li><p>报错图示</p>
</li>
</ul>
<p><img src="./index_files/image-20201208170757684.png" alt="image-20201208170757684"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">Uncaught  ReferenceError:   Arr  is  not  defined
未捕获到   引用错误            Arr变量 是 没有 定义的

Arr 没有定义过
参考代码和报错, 发现我们实际上想使用的变量名叫arr, 所以你不小心写错了
</code></pre>
</li>
<li><p>解决, 改成正确的变量名</p>
<pre><code class="lang-js">var arr = [1, 5, 3, 2, 10];
arr.push(100);
</code></pre>
</li>
<li><p>总结: 再发现xxx is not defined, 就是你变量没有访问到, 检查下你的代码</p>
</li>
</ul>
<h3 id="10102">1.1.2. 问题: Cannot read property 'forEach' of undefined</h3>
<p>错误描述: undefined不能读取属性forEach</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">// 1.2 (基础) - 把数组数据铺设到页面上
var arr = res.date;
arr.forEach(function(obj){
    let {id, publisher, author, bookname} = obj;
    var theTr = `&lt;tr&gt;
&lt;td&gt;${id}&lt;/td&gt;
&lt;td&gt;${bookname}&lt;/td&gt;
&lt;td&gt;${author}&lt;/td&gt;
&lt;td&gt;${publisher}&lt;/td&gt;
&lt;td&gt;
&lt;a href="javascript:;" class="del"&gt;删除&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;`;
    $("#tb").prepend(theTr);
})
</code></pre>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/image-20201216212915180.png" alt="image-20201216212915180"></p>
<ul>
<li>错误分析</li>
</ul>
<pre><code class="lang-js">在第80行有问题, 查看报错的代码
是arr读取的forEach方法, 报错说arr是个undefined(说明arr变量里的值是undefined)
顺藤摸瓜:
那么观察arr的值是在上面res.date给的

那打印res观察 (很关键, 一定要学会打印)
发现res的数据再data属性上, 而非date. 发现是拼写错误咯
</code></pre>
<ul>
<li>解决:</li>
</ul>
<pre><code class="lang-js">var arr = res.data;
</code></pre>
<ul>
<li>总结: 当发现问题后, 要学会顺腾摸瓜, 变量只是个代号, 而变量里装的什么只有打印出来才知道</li>
</ul>
<h3 id="10103">1.1.3. 问题: xxx.foreach is not a function</h3>
<p>错误描述: xxx调用了foreach, 但不是一个方法</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">var arr = [1, 2, 3];
arr.foreach(function (val) {
    console.log(val);
})
</code></pre>
<ul>
<li>报错提示</li>
</ul>
<p><img src="./index_files/image-20210118204932195.png" alt="image-20210118204932195"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">Uncaught TypeError: arr.foreach is not a function
未捕获到 引用错误  arr.foreach 不是一个方法

说白了, 就是arr对象身上没有foreach方法, 为啥呢? 
你打印arr变量, 展开前面小箭头, 你好好看看foreach方法怎么写的 是不是叫forEach
注意了JS这门语言是区分大小写的 就是foreach和forEach不是一个人
</code></pre>
<ul>
<li>解决</li>
</ul>
<pre><code class="lang-js">arr.forEach
</code></pre>
<ul>
<li>总结: 在遇到 xxx.yyy  不是一个方法, 那就证明这个对象没有这个方法, 打印这个对象先看看 好好合计合计</li>
</ul>
<h3 id="10104">1.1.4. 报错: Failed to execute 'append' on 'FormData': 2 arguments required, but only 1 present.</h3>
<p>错误描述: 未能对“FormData”执行“append”：需要2个参数，但仅存在1个参数。</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">var fileObj = $("#file1")[0].files[0];
var fd = new FormData();

fd.append(fileObj); // 这行报错了, 正确写法 fd.append("参数名", 值")
</code></pre>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/image-20210118210319161.png" alt="image-20210118210319161"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">Failed to execute 'append' on 'FormData': 2 arguments required, but only 1 present.
执行失败 在FormData上使用append: 必须2个参数, 但是目前仅仅1个

发现代码里append相关有-确实fileObj应该是值, 少个参数名
</code></pre>
<ul>
<li>解决</li>
</ul>
<pre><code class="lang-js">fd.append("img", fileObj); // 传参给后台, 参数名要跟后台对上
</code></pre>
<ul>
<li>总结: 看不懂翻译, 可以百度翻译. </li>
</ul>
<h2 id="102">1.2. JS高级</h2>
<h3 id="10201">1.2.1. 报错：Must call super constructor ...</h3>
<p>错误描述: 必须调用父类的constructor构造函数</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">class Father {
    say() {
        return '我是爸爸';
    }
}
class Son extends Father {
    constructor(x, y) {
        this.x = x;
        super(); 
    }
}

new Son();
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/1597494688886.png" alt="1597494688886"></p>
<ul>
<li>分析：使用ES6对其它类进行继承时，语法报错</li>
</ul>
<pre><code class="lang-js">Must call super constructor in derived class before accessing 'this' or returning from derived constructor
在访问“ this”或从派生构造函数返回之前，必须在派生类中调用super 构造函数

所以: 在继承其它构造函数之前，需要使用super关键字对父级的形参进行确认；再使用this
</code></pre>
<ul>
<li>解决：</li>
</ul>
<pre><code class="lang-js">class Father {
    say() {
        return '我是爸爸';
    }
}
class Son extends Father {
    constructor(x, y) {
        super(); // 要在使用this之前使用super()
        this.x = x;
    }
}
new Son();
</code></pre>
<ul>
<li>总结：无论父亲上面有没有属性，只要在子类中构造器函数内部操作this，就需要super 把父级相关的 属性进行确认；</li>
</ul>
<h3 id="10202">1.2.2. 逻辑: 在constructor里返回的不是实例对象</h3>
<p>描述: 发现new完返回来的对象上没有模板里的属性</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">class Person {
    constructor() {
        this.name = "";
        this.age = 0;
        return { ok: 100 }
    }
    run(){}
}
var per = new Person();
console.log(per); // {ok: 100} 
// 原因 - 因为constructor默认返回this的值(new出来的实例对象), 但是如果你显示的有return就会覆盖, per就是return后的值了
</code></pre>
<ul>
<li><p>分析:</p>
<p>new会创建一个空白对象, 在constructor里绑定属性和方法后, <strong>默认</strong>返回到new的地方, 打印发现per对象里没有name和age</p>
<p>那就证明return有问题</p>
<p>综合代码发现return竟然不是默认的, 而是手写了一个新的对象</p>
</li>
<li><p>解决: 把return {ok: 100} 去掉, 默认返回实例对象</p>
<pre><code class="lang-js">class Person {
    constructor() {
        this.name = "";
        this.age = 0;
    }
    run(){

    }
}
var per = new Person();
console.log(per); // {name: "", age: 0} 
</code></pre>
</li>
<li><p>总结: 不要在constructor里写return 哦</p>
</li>
</ul>
<h2 id="103">1.3. jQ</h2>
<h3 id="10301">1.3.1. 报错: Cannot read property 0 of undefined</h3>
<p>错误描述: undefined不能读取属性0</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">// 1. 按钮 - 点击事件
$("#sendBtn").on("click", function(){
    // 2. 要值
    var nameInp = $("#nameInp").val;
    let aInp = $("#aInp").val();
    let pInp = $("#pInp").val();
    // 3. ajax -&gt; 发给后台
    $.post("http://123.57.109.30:3006/api/addbook", {
        bookname: nameInp,
        author: aInp,
        publisher: pInp,
        appkey: "7250d3eb-18e1-41bc-8bb2-11483665535a"
    }, function(res){
        console.log(res);
    })
})
</code></pre>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/image-20201216212529509.png" alt="image-20201216212529509"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">1.根据报错提示, jQ的8436行代码有问题, 但是jQ又不是你的代码所以不用看
2.发现下面还有一些代码片段提示, 倒数第三个是自己写的html文件, 第23行代码报错了
3.回头看23行代码, 是$.post() 这行发送网络请求的代码 - 但是怎么也看不出来读取0, 谁读0了, 咋办?
4.和对url和appkey都是复制的没问题, 那就是变量有问题了, 打印这几个变量观察值到底是什么?
    console.log(nameInp, aInp, pInp)
</code></pre>
<ol start="5">
<li>发现第一个参数是个函数, 不是具体的值</li>
</ol>
<p><img src="./index_files/image-20201216212735657.png" alt="image-20201216212735657"></p>
<ol start="6">
<li>那nameInp变量的值是在上面用=赋值运算符给的</li>
<li><p>所以var nameInp = $("#nameInp").val;  右侧有问题, 发现val是JQ的方法得加()啊</p>
</li>
<li><p>解决:</p>
</li>
</ol>
<pre><code class="lang-js">// 1. 按钮 - 点击事件
$("#sendBtn").on("click", function(){
    // 2. 要值
    var nameInp = $("#nameInp").val();
    let aInp = $("#aInp").val();
    let pInp = $("#pInp").val();
    // 3. ajax -&gt; 发给后台
    $.post("http://123.57.109.30:3006/api/addbook", {
        bookname: nameInp,
        author: aInp,
        publisher: pInp,
        appkey: "7250d3eb-18e1-41bc-8bb2-11483665535a"
    }, function(res){
        console.log(res);
    })
})
</code></pre>
<ul>
<li>总结: jQ一般都是方法, 记得加()</li>
</ul>
<h3 id="10302">1.3.2. 问题: 点击按钮 - 无反应</h3>
<p>问题描述: 点了按钮什么反应也没有</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">$("#goto-register2").on("click", () =&gt; {
    $("#register").stop().show();
})
</code></pre>
<ul>
<li>分析:</li>
</ul>
<pre><code class="lang-js">1. 那证明里面这行代码可能没执行, 可以在这打印下$("#register")
(1): 如果打印执行了, 证明外面$("#goto-register2").on("click")肯定没问题 - 再分析内部
(2): 如果没打印, 证明外面$("#goto-register2")可能没获取到, 打印看看值对不对, 顺腾摸瓜

2. 这道题发现什么都没打印, 那肯定是(2)方式, 绑定有误所以打印$("#goto-register2")发现有问题
后来去对了下#后面的id值, 发现写错了没有2
</code></pre>
<ul>
<li>解决</li>
</ul>
<pre><code class="lang-js">$("#goto-register").on("click", () =&gt; {
    console.log($("#register"));
    $("#register").stop().show();
})
</code></pre>
<ul>
<li>总结: 学会顺腾摸瓜找到问题</li>
</ul>
<h1 id="2">2. 网络编程</h1>
<h2 id="201">2.1. 报错: net::ERR_INTERNET_DISCONNECTED</h2>
<p>错误描述: 因特网已经断开连接</p>
<ul>
<li>互联网已经断开</li>
<li>解决: 请确认自己的网络是否正常 (可以开一个网页看看能不能上淘宝)</li>
</ul>
<h2 id="202">2.2. 报错: 只要见到timeout</h2>
<ul>
<li>网络超时, 用接口调试工具排查是否是后台接口的问题, 具体看后台有无响应<ul>
<li>无响应, 找后台人去重启服务器</li>
<li>有响应, 根据错误提示解决问题</li>
</ul>
</li>
</ul>
<h2 id="203">2.3. 报错: 404 (Not Found)</h2>
<p>错误描述: 没有找到你想访问的</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">axios({
    method: 'get',
    url: 'http://123.57.109.30:3006/api/getbooks2',
    params: {
        id: 1,
        bookname: '西游记'
    }
}).then(function (res) {
    console.log(res)
})
</code></pre>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/image-20210118162340361.png" alt="image-20210118162340361"></p>
<ul>
<li><p>分析: axios.js 不是我的代码啊, 左边有个箭头展开, 下面有个小箭头指向的是你自己的代码引发的错误, 所以发现是axios请求有问题</p>
</li>
<li><p>解决</p>
<p>根据业务, 把url改成正确的后台地址即可</p>
</li>
<li><p>总结:</p>
<p>只要再看到404, 就是你要请求的url地址不对, 具体是哪一个, 根据报错的提示行数即可找到</p>
</li>
</ul>
<h2 id="204">2.4. 报错: Access to XMLHttpRequest</h2>
<p>错误描述: Ajax链接有问题</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">axios({
    method: 'get',
    url: 'http://localhost:2001/api/getbooks',
    params: {
        id: 1,
        bookname: '西游记'
    }
}).then(function (res) {
    console.log(res)
})
</code></pre>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/跨域了_不要用vscode打开_后台既返回网页也返回接口数据.png" alt="跨域了_不要用vscode打开_后台既返回网页也返回接口数据"></p>
<ul>
<li>分析: </li>
</ul>
<pre><code class="lang-js">Access to XMLHttpRequest 
Ajax跨域了 从 http://127.0.0.1:5501 要请求 http://localhost:2001/api/getbooks

概念: 协议/ip域名/端口 ajax所在页面的, 和ajax要请求的 有一个对不上的, 就发生了跨域
浏览器默认虽然支持cors跨域资源访问, 但是后台如果不允许的话, 浏览器会拦截这个ajax请求
所以报错的后半句是: 没有再响应头里找到Access-Control-Allow-Origin的头(后台没有允许)
</code></pre>
<ul>
<li><p>解决</p>
<p>要么去让后台开启cors跨域资源共享, 或者是前端使用服务器代理请求</p>
</li>
</ul>
<h1 id="3">3. vscode相关插件</h1>
<h2 id="301">3.1. 问题: vscode插件 - post请求不发送</h2>
<p>问题描述, 点击Rest Client插件编写的.http文件上的Send Request本想发送这个http请求, 但是右下角报错</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20201216214624166.png" alt="image-20201216214624166"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">Header name must be a valid HTTP 
请求头 名字 必须是一个合法的

注意, http请求报文结构中, 
第一行是请求方式, 请求URL地址
第二行往下每行都是一对请求头的名字:值  (千万不能带分号后面, 这也不是js代码, 这是http请求报文)
空行 (必须的, 规定, 因为下面是请求体的参数不再是请求头的一部分了)

请求体的内容参数和值

</code></pre>
<ul>
<li>解决: 在Content-Type下面加一行空行就好了</li>
<li>总结: 注意Content-Type下面一行必须有空行(用回车隔出来一个哦) - 这是这个插件的规定</li>
</ul>
<h1 id="4">4. git</h1>
<h2 id="401">4.1. 问题: not a git repository</h2>
<p>错误描述: 没有一个git仓库(存储)</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210118201253810.png" alt="image-20210118201253810"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">fatal: not a git repository (or any of the parent directories): .git
致命错误: 没有git仓库(或任何父目录中) 有.git文件夹的

这个.git文件夹 (要么git clone拉取远程仓库产生), 要么git本地仓库(git init)初始化的
你现在少这个.git隐藏的文件夹啊

补充知识: .git里管理着git相关的一切
</code></pre>
<ul>
<li>解决:  这里是要把项目传到服务器上, 所以需要本地自己初始化一个 运行命令git init</li>
<li>总结: 根据错误提示, 想想怎么解决/百度解决问题的方法</li>
</ul>
<h2 id="402">4.2. 问题: failed to push some refs to 'xxxxx'</h2>
<p>错误描述: xxxx地址看你自己的, 跟我的可能不一样, 但是前面错误提示是一样的</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/image-20210118211442802.png" alt="image-20210118211442802"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">error: src refspec master does not match any
错误: master分支里没有任何匹配的东西

error: failed to push some refs to 'gitee.com:itcz_jiaoyu/good122.git'
错误: 推送文件到'地址'的时候失败了

综上所述: 是你本地没有暂存和提交, 没什么可以推送的啊 
</code></pre>
<ul>
<li>解决: 先去git add 和 git commit -m '提示'</li>
<li>总结: 根据英文就知道什么意思啦</li>
</ul>
<h2 id="403">4.3. 问题: Access deined You do not have premission push to this repository</h2>
<p>错误描述: 您没有预授权，访问此存储库</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/image-20210119001543049.png" alt="image-20210119001543049"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">1. 远程仓库如果是你的, 证明你账号/密码输入错误(如果用的是http的git地址), 请输入正确的
   远程仓库是你的, 用ssh地址进行推送, 请确认你的ssh秘钥是正确配置的(包括文件名是否在正确的默认位置)
2. 远程仓库别人的, 请让他在这个项目里把你加入到他的项目成员里, 你才有权限推送哦
</code></pre>
<ul>
<li>解决: 权限不对, 请按照分析的去核对</li>
</ul>
<blockquote>
<p>自己的就配置ssh / 确认账号密码正确(登录你git远程仓库网站的账号和密码)</p>
<p>如果别人的, 请让他拉你进它的项目组里(如果是gitee.com, 你需要在右上角小铃铛的私信里确认邀请链接)</p>
</blockquote>
<p><img src="./index_files/image-20210119002144854.png" alt="image-20210119002144854"></p>
<h2 id="404">4.4. 问题: Repository Not Found</h2>
<p>错误描述:  仓库没找到</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/66fc738d-8caa-4b6c-9606-8f4fad5ba4a8.png" alt="66fc738d-8caa-4b6c-9606-8f4fad5ba4a8"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">git 克隆说没有找到这个远程仓库
那肯定就是你的远程仓库地址不对
重新找一下复制一下
</code></pre>
<ul>
<li>解决: 地址不对, 发现yiaoyu是jiaoyu地址用错了</li>
</ul>
<h1 id="5">5. 大事件项目</h1>
<h2 id="501">5.1. 问题: 表单提交 - 无反应</h2>
<p>问题描述: 点击按钮提交表单, 本想着是Ajax提交, 但是发现==<strong>网页刷新闪了一下</strong>==</p>
<p><img src="./index_files/image-20201215125709038.png" alt="image-20201215125709038"></p>
<ul>
<li>问题代码:</li>
</ul>
<pre><code class="lang-js">$("#register .layui-form").on("submit", ev =&gt; {
    ev.preventDefalt();
    var data = {
        username: $("#register input[name=username]").val(),
        password: md5($("#register input[name=password]").val())
    }
    registerAPI(data, () =&gt; {
        // 显示登录页面 - 让用户登录
        $("#register").stop().hide();
    });
})
</code></pre>
<ul>
<li>分析: 证明表单自己提交了, 你并未阻止了form默认的submit事件</li>
</ul>
<pre><code class="lang-js">排查: 所以找到绑定submit事件那里, 观察你的阻止默认行为的代码 (特别是单词 是否正确)

发现preventDefalt() 单词拼写错误, 正确应该是preventDefault()
</code></pre>
<ul>
<li><p>解决: 把单词改成正确的即可</p>
</li>
<li><p>总结: 多在心中念, 念的时候就知道怎么拼写了, 如果上面单词对了, 请检查on绑定事件是否正确 - 以及前面标签获取是否正确</p>
</li>
</ul>
<h2 id="502">5.2. 问题: 提示 - 用户名/密码 undefined</h2>
<ul>
<li>问题代码</li>
</ul>
<pre><code class="lang-js">$("#register .layui-form").on("submit", ev =&gt; {
    ev.preventDefault();
    var data = {
        username: $("#register .input[name=username]").val(),
        password: md5($("#register .input[name=password]").val())
    }
    registerAPI(data, () =&gt; {
        // 显示登录页面 - 让用户登录
        $("#register").stop().hide();
    });
})
</code></pre>
<ul>
<li>分析 - 说明你的data里的值有问题, 在data上面打印一下, 然后操作下页面, 复现一下</li>
</ul>
<pre><code class="lang-js">// 既然说我用户名是undefined, 就打印下获取的用户名标签里的val()值
console.log($("#register .input[name=username]").val());
// 发现值确实是undefined
那肯定这行代码有问题, 逐个选择器分析, 发现是最后发现是input前面多了个.  (input是标签名不是class)

</code></pre>
<h2 id="503">5.3. 问题: 验证规则不生效</h2>
<ul>
<li>现象: 点击提交按钮 - 发现我故意违反了我定义的正则规则, 但是不给我出提示框</li>
<li>分析:</li>
</ul>
<pre><code class="lang-js">1. 我们使用的是layui.css和layui.js 2个文件里的样式和js功能代码 - 先确保正确引入
2. 这个 form标签内的按钮  身上 必须有layui-submit 属性 - 才会检验 (规定)
3. 如果上面2个都确定完了. 那么确定你表单标签身上有 lay-verify属性 而且值的格式是对的如下(==多个规则之间不能有空格==
4. 例如: &lt;input lay-verify="required|usern"&gt;
5. 如果还不行 - 就是你规则里定义出问题了去检查
form.verify({
    usern: [ // 用户名
        /^[a-z0-9]{6,10}$/
    ],
})
// 发现只有规则, 没有提示
</code></pre>
<ul>
<li>解决: 把提示文字在数组第二个元素补上(layui规则规定, 第二个值是提示文字)</li>
</ul>
<pre><code class="lang-js">form.verify({
    usern: [ // 用户名
        /^[a-z0-9]{6,10}$/,
        "用户名6到10位的数字和小字母组成"
    ],
})
</code></pre>
<h2 id="504">5.4. 问题: 后台返回400</h2>
<p>错误描述: 后台在影响状态码为400, 后台通知我们这次http请求有问题</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">let data = {
    oldPwd: md5($("input[name=oldPwd]").val()),
    newPwd: md5($("input[name=newPwd]").val())
}
// 后台不支持json, 所以必须用objToArg方法转成key=value
rePassAPI(data, () =&gt; {
    // 重置成功
    let s = setTimeout(() =&gt; {
        sessionStorage.removeItem("token");
        // 这里要格外注意, window指的是iframe内嵌的网页repwd页面, 而我们想让index.html整个网页跳转到登录页面, 所以window.parent - 返回当前窗口的父窗口对象
        window.location.href = "/login.html";
        clearTimeout(s)
    }, 2000);
})
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/image-20201215181421549.png" alt="image-20201215181421549"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-js">后台提示我oldPwd的字段有问题
1. oldPwd参数名没错, 必须传的oldPwd字段传递了参数名
2. 那就是值有问题, 所以去打印js代码里, 发现值也是32位的字符了啊
3. axios在data请求体里发送的都是application/json的内容格式 - 也就是给后台发的json字符串格式 (而这个项目的后台只能解析key=value&amp;key=value字符串 - 所以这个问题比较隐晦
</code></pre>
<ul>
<li>解决</li>
</ul>
<p>在发送参数对象时, 先把对象转成key=value&amp;key=value字符串哦</p>
<h2 id="505">5.5. 问题: 上传头像没反应</h2>
<ul>
<li>描述: 点击上传头像, 半天也没有反应, 也没有状态码, 而且看response后台没有任何的东西返回</li>
</ul>
<p><img src="./index_files/image-20201215192836179.png" alt="image-20201215192836179"></p>
<ul>
<li>原因: 因为前台还在发送字符串给后台, 后台还没接收完. 半天没反应, 证明前端上传的数据过大. </li>
<li>问题代码:</li>
</ul>
<pre><code class="lang-js">const canvas = cropper.getCroppedCanvas({
    width: 500,
    height: 500
}); // 因为canvas标签太大了. 图片太大, 改成100就好了
</code></pre>
<p>avatar有问题导致虽然接口成功, 但是图片获取还是没有</p>
<h1 id="6">6. SQL相关</h1>
<h2 id="601">6.1. 解决ID不连续问题</h2>
<p>可以把teacher换成自己具体的表名即可</p>
<p>ALTER TABLE teacher DROP id;
ALTER TABLE teacher ADD id int NOT NULL FIRST;
ALTER TABLE teacher MODIFY COLUMN id int NOT NULL AUTO_INCREMENT,ADD PRIMARY KEY(id);</p>
<h1 id="7">7. Node</h1>
<h2 id="701">7.1. node相关</h2>
<h3 id="490101">7.1.1. 问题: 安装弹窗error 2503</h3>
<p>错误描述: 提示安装包和安装进程有问题</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/用硬盘版安装_自己配置环境变量.png" alt="用硬盘版安装_自己配置环境变量"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">这个安装程序, 这个安装包有问题, 可以百度搜索下2503的解决方案

如果都不行, 就不要用.msi安装程序了, 直接去官网下载硬盘版(二进制的文件)直接手动配置环境变量(可以百度搜索)
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">硬盘版安装
或者
看这个地址操作: https://jingyan.baidu.com/article/cdddd41c97e94853ca00e17e.html
</code></pre>
</li>
</ul>
<h2 id="702">7.2. npm相关</h2>
<h3 id="490201">7.2.1. 报错: 无法识别为可运行程序的名称</h3>
<p>错误描述: 输入的命令不存在</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/node命令才能执行js文件.png" alt="node命令才能执行js文件"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">这是要node xxx 用node执行这个js文件吧?
报错说命令怎么是我这个js文件呢?
啊, 原来没写node
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">node 下载的包引入使用.js
</code></pre>
</li>
<li><p>总结: 执行js文件, 要用node命令哦</p>
</li>
</ul>
<h3 id="490202">7.2.2. 报错: 403 You cannot publish over the previously published versions:1.0.0</h3>
<p>错误描述: 你不能发布这个版本</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/version数字需要增加_版本更新.png" alt="version数字需要增加_版本更新"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">403 You cannot publish over the previously published versions:1.0.0

不能在以前发布的版本上发布版本：1.0.0

原因是因为之前已经发布了1.0.0版本了, 你得修改下一个版本号再发布了
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">去package.json文件中, 手动把1.0.0 改成1.0.1 或者自己按照自己规则往上增加, 大修改.中修改.小修改
</code></pre>
</li>
</ul>
<h3 id="490203">7.2.3. 报错: 400 "xxx" is invalid for new packages</h3>
<p>错误描述: 新包名不合法</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/包名_不能大写开头.png" alt="包名_不能大写开头"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">403 "Raincr" is invalid for new packages

"自己的包名" 不是一个新的合法的包名

说你的R大写开头不合法
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">去修改package.json的name属性的值(这是发布用的包名) - 但是建议文件夹名也一致(方便对应)
</code></pre>
</li>
</ul>
<h3 id="490204">7.2.4. 报错: 403 Package name triggered spam detection</h3>
<p>错误描述: 包名触发的垃圾邮件检测</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/包名太长了_packagename.png" alt="包名太长了_packagename"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">403 Package name triggered spam detection
包名太垃圾了 哈哈哈哈开个玩笑, 就是不能乱写一点规则都没有啊

改为正常的包名
一般英文开头, 单词含义, -中划线链接
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">去package.json里改name的值, 文件夹最好保持一致
</code></pre>
</li>
</ul>
<h3 id="490205">7.2.5. 问题: 网页 Too Many Request</h3>
<p>错误描述: 太多请求了</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/短时间有太多人请求_等一会儿再来.png" alt="短时间有太多人请求_等一会儿再来"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">Too Many Requests
太多的请求了

这个网站短时间有太多的请求, 就会拒绝正常逻辑响应
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">换个网络 / 等1个小时以后再来注册吧
</code></pre>
</li>
</ul>
<h3 id="490206">7.2.6. 报错: operation not permitted</h3>
<p>错误描述: 不允许操作</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/改nodejs软件夹为管理员权限.png" alt="改nodejs软件夹为管理员权限"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">operation not permitted
不允许操作

说你没有权限
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">请以管理员方式打开终端, 可以百度看看怎么用管理员方式打开, 在搜索框里搜索右键图标, 有管理员方式打开
</code></pre>
</li>
</ul>
<h3 id="490207">7.2.7. 报错: 403 tors can unpublish module</h3>
<p>错误描述: 不能删除模块包</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/切成淘宝镜像.png" alt="切成淘宝镜像"></p>
<ul>
<li><p>分析</p>
<p><code>`</code>js
403 Forbidden - DELETE <a href="https://registry.npm.taobao.org/xxx">https://registry.npm.taobao.org/xxx</a> -tors can unpublish module</p>
</li>
</ul>
<p>  说你没有权限删除, 发现发布的包都在官方的镜像地址上, 但是这里怎么有淘宝字样</p>
<p>  所以你没有切换npm的镜像地址</p>
<pre><code>
* 解决

  ```js
  npm config set registry https://registry.npmjs.org

  然后在执行删除包命令
</code></pre><h3 id="490208">7.2.8. 报错: 502 Bad Gateway</h3>
<p>错误描述:  网关错误</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/网络不行_停止重新来一遍.png" alt="网络不行_停止重新来一遍"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">502 5开头的一般都是服务器错误, 所以后台问题网络问题
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">切换网络 / ctrl+c停止后, 再重新来一遍
</code></pre>
</li>
</ul>
<h3 id="490209">7.2.9. 报错: this is a problem related to network connectivity</h3>
<p>错误描述:  这是一个与网络连接有关的问题</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/网络问题.png" alt="网络问题"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">request to https://registry.npmjs.org/~/v1/login filed reason: getaddrinfo ENOTFOUND registry.npmjs.org

请求时, 找不到这个地址

一般是网络问题
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">切换网络 / ctrl+c停止后, 再重新来一遍
</code></pre>
</li>
</ul>
<h3 id="490210">7.2.10. 报错: xxxx不是内部或外部命令</h3>
<p>错误描述:  本机没有这个命令</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/文件名或者文件夹不能和包名模块名重名.png" alt="文件名或者文件夹不能和包名模块名重名"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">nodeomon 不是内部或外部命令

一切的命令都要安装到电脑里的程序员用的软件, 而且要成功配置到计算机的环境变量里, cmd终端里才能执行这个命令程序

nodemon 是替代node命令来实时更新js代码运行的效果的, 很明显单词打错了

// 如果单词没错就是环境没安装对, 重新安装即可
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">nodemon xxxx.js
</code></pre>
</li>
</ul>
<h3 id="490211">7.2.11. 报错: 403</h3>
<p>错误描述:  邮箱没有验证</p>
<ul>
<li>报错图示</li>
</ul>
<p><img src="./index_files/邮箱验证未成功.png" alt="邮箱验证未成功"></p>
<p><img src="./index_files/邮箱没去验证.png" alt="邮箱没去验证"></p>
<p><img src="./index_files/邮箱没有验证.png" alt="邮箱没有验证"></p>
<ul>
<li><p>分析</p>
<pre><code class="lang-js">403 Forbidden
一般都是没有权限

1. 请确认你包的package.json文件名字 和 npmjs.com网站上没有重名的才可以
2. 在npmjs.com注册账号的时候, 会给你填写的邮箱里发一封右键, 必须点击右键里的verify按钮验证链接才算验证激活 (才能用这个账号向npm网站发布包)
</code></pre>
</li>
<li><p>解决</p>
<pre><code class="lang-js">去npmjs.com登录你的账号 / 邮箱里找找有没有这个邮件 
如果都没有重新注册一个邮箱再来注册这个网站 (如果不想发布也可以了解下就行了_ 哈哈)
</code></pre>
</li>
</ul>
<h2 id="703">7.3. express相关</h2>
<h1 id="8">8. webpack</h1>
<h2 id="801">8.1. 报错：An unexpected error occurred</h2>
<p>错误描述: 发生意外的错误</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210228215954072.png" alt="image-20210228215954072"></p>
<ul>
<li>分析:</li>
</ul>
<p>看后面说package.json里的JSON格式有问题, 大概在177个字符位置</p>
<ul>
<li>解决:</li>
</ul>
<p>JSON格式非常严谨, 必须都是英文的标点, 而且只能用双引号, key也得是双引号</p>
<p>JSON格式: 大括号里往里嵌套, 最外层不能是并列的大括号, 所以看看是不是写外面了</p>
<p>==可能会隐藏中文的空格, 自己调整输入法重写下==</p>
<h2 id="802">8.2. 报错：Unknown command or entry</h2>
<p>错误描述: 不知道命令或入口</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210228220433811.png" alt="image-20210228220433811"></p>
<ul>
<li>分析:</li>
</ul>
<p>不知道命令或入口 --config webpack.config.js</p>
<ul>
<li><p>解决:</p>
</li>
<li><p>package.json并列处有无webpack.config.js (拼写啥的对不)</p>
</li>
<li>可能--config 周围有中文空格, 调整好输入法再重写下 </li>
</ul>
<h2 id="803">8.3. 报错：Cannot find module xxx</h2>
<p>错误描述: 找不到模块</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210228220717854.png" alt="image-20210228220717854"></p>
<ul>
<li>分析:</li>
</ul>
<p>找不到模块, 具体后面看是webpack.config.js这个模块文件</p>
<ul>
<li><p>解决:</p>
</li>
<li><p>看看路径下有无这个文件(应该是package.json并列出, 因为你自定义命令就是并列路径)</p>
</li>
<li>路径上不要出现webpack名字的文件夹</li>
</ul>
<h2 id="804">8.4. 报错：Cannot resolve vue</h2>
<p>错误描述: 不能引入vue</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/不能引入vue.png" alt="不能引入vue"></p>
<ul>
<li>分析:</li>
</ul>
<p>找不到模块vue, 这是个第三方的vue包</p>
<ul>
<li><p>解决:</p>
</li>
<li><p>在当前所在工程下, 下载vue包即可</p>
</li>
</ul>
<h2 id="805">8.5. 报错：Invalid package name</h2>
<p>错误描述: 包名称无效</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210228222523609.png" alt="image-20210228222523609"></p>
<ul>
<li>分析:</li>
</ul>
<p>yarn init为了初始化包环境得到package.json</p>
<p>终端会问你, 你的包名叫什么, 直接回车会用当前文件夹名也 就是括号里的</p>
<p>但是我们好像有中文/特殊符号</p>
<ul>
<li>解决:</li>
</ul>
<p>文件夹是文件夹, 包名是包名 不冲突, 所以在后面不能直接回车, 随便给个合法的名字即可</p>
<h2 id="806">8.6. 报错：Can`t resolve xxx</h2>
<p>错误描述: 不能引入xxx什么了</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210228223227102.png" alt="image-20210228223227102"></p>
<ul>
<li>分析:</li>
</ul>
<p>得能从这个报错信息里, 提取有用的信息, 发现说不能引入jquery了</p>
<ul>
<li>解决:</li>
</ul>
<p>发现好像忘记下jquery了, 或者重新下载一遍</p>
<h2 id="807">8.7. 报错：无法将"yarn"识别为  cmdlet</h2>
<p>错误描述: 终端不能识别yarn为命令使用</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210301205936857.png" alt="image-20210301205936857"></p>
<ul>
<li>分析:</li>
</ul>
<p>图里用的是powerShell终端, win10新出的, 执行策略帮助你防止执行不信任的脚本</p>
<ul>
<li>解决:</li>
</ul>
<p>在终端执行: <code>set-ExecutionPolicy RemoteSigned</code></p>
<p><img src="./index_files/image-20210301215640371.png" alt="image-20210301215640371"></p>
<h2 id="808">8.8. 报错：The engine "node" is incompatible</h2>
<p>错误描述: node引擎不兼容</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210301222005830.png" alt="image-20210301222005830"></p>
<p>也可能这张</p>
<p><img src="./index_files/win7的下node12.png" alt="win7的下node12"></p>
<ul>
<li>分析:</li>
</ul>
<p>图1: 希望node版本大于10.17.0, 但是现在的是10.16.0</p>
<p>图2: 希望node版本在10.x 或者12.x 或者大于14, 但你是13(唯独不是那几个范围的) 去重新下个node即可</p>
<ul>
<li>解决:</li>
</ul>
<p>去node官网下载一个大于10.17的版本的nodejs, 在当前电脑覆盖式安装即可</p>
<h2 id="809">8.9. 报错：webpack不是内部或外部命令</h2>
<p>错误描述: 执行自定义命令时, 真正打包命令叫webpack</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210301222310006.png" alt="image-20210301222310006"></p>
<ul>
<li>分析:</li>
</ul>
<p>很有可能你当前工程下没有webpack, 去package.json确认下, 如果真没有就下载即可</p>
<ul>
<li>解决:</li>
</ul>
<p>重新在当前工程下载webpack (如果webpack4以上版本还需要下载webpack-cli)</p>
<h2 id="810">8.10. 报错：Couldn't find a package.json file</h2>
<p>错误描述: 不能找到package.json文件</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210301224737730.png" alt="image-20210301224737730"></p>
<ul>
<li>分析:</li>
</ul>
<p>不能找到package.json文件, 在01_笔记和ppt目录下确定下是否有package.json文件</p>
<p>是否命令所在文件夹下没有这个package.json文件</p>
<p>因为yarn build自定义命令, 在当前目录下找到package.json文件的script的build命令</p>
<ul>
<li>解决:</li>
</ul>
<p>确认下终端敲命令时, 当前所在文件夹路径是否正确</p>
<h2 id="811">8.11. 报错：yarn 不是内部或外部命令</h2>
<p>错误描述: yarn不是命令, 无法使用</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/image-20210301233957677.png" alt="image-20210301233957677"></p>
<ul>
<li>分析:</li>
</ul>
<p>安装yarn软件, 会自动配置环境变量到电脑里, cmd终端所用的命令都是在我的电脑里的环境变量的</p>
<p>执行的命令其实都对应着电脑里的应用程序</p>
<ul>
<li>解决:</li>
</ul>
<p>方案1: 重新安装下yarn软件, 而且目录上不能出现yarn文件夹名字/叫yarn的文件名 -- 否则就覆盖了环境变量使用不了真正的yarn应用程序了</p>
<p>方案2: 可以用npm install -g yarn (安装个全局yarn命令) - 如果还不行就把yarn和node都卸载后重新安装到c盘下</p>
<h2 id="812">8.12. 报错: 系统找不到指令路径</h2>
<p>错误描述: 执行yarn build打包找不到系统路径</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/yarn build系统找不到指令路径.png" alt="yarn build系统找不到指令路径"></p>
<ul>
<li>分析:</li>
</ul>
<p>yarn打包时, 要使用webpack命令, 内部需要node环境, 所以猜测应该是node有问题</p>
<ul>
<li>解决:</li>
</ul>
<p>node安装路径上不要出现中文, 建议yarn和node都安装到c盘的无中文路径下面</p>
<h2 id="813">8.13. 报错: in ./public/index.html</h2>
<p>错误描述: 模块解析失败, 不能处理html文件</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/不要把html引入到js里.jpg" alt="不要把html引入到js里"></p>
<ul>
<li>分析:</li>
</ul>
<p>你可能把html文件引入到js里了, webpack分析到了你的html文件, 但是你没有加载器/插件能打包html文件</p>
<ul>
<li>解决:</li>
</ul>
<p>其实我们是用插件,让html作为模板自动生成一个html文件, 而不是要在js里引入啊</p>
<h2 id="814">8.14. 报错: Command "xxx" not found</h2>
<p>错误描述:  命令没有找到</p>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/命令没有找到.png" alt="命令没有找到"></p>
<ul>
<li>分析:</li>
</ul>
<p>yarn serve命令来自于package.json中</p>
<ul>
<li>解决:</li>
</ul>
<p>发现package.json中名字写的跟要执行的不一样</p>
<h1 id="9">9. Vue基础</h1>
<h2 id="901">9.1. JS语法类错误</h2>
<h3 id="810101">9.1.1. 报错：xx is not defined</h3>
<p>错误描述: 变量未定义</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;
&lt;div id="app"&gt;&lt;/div&gt;
&lt;script&gt;
  const vm = new Vue({
    el: '#app',
    methods: {
      add() {
        // 使用了未申明的变量a
        a++
      }
    },
    mounted() {
      this.add()
    }
  })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/1.png" alt="1.png"></p>
<ul>
<li>分析:</li>
</ul>
<p>vue框架针对这类错误会给出俩块错误提示 </p>
<blockquote>
<p>标记为1的地方是vue框架给出的发生错误的组件中的位置  上图的意思是错误发生在Root根组件的mounted声明周期函数中</p>
<p>标记为2的地方是vue框架给出的发生错误的js语言中调用栈的位置 上图的意思是错误发生在add方法调用的时候</p>
</blockquote>
<ul>
<li>解决:</li>
</ul>
<p>!&gt; 这一类错误都是相同的排错方式   按照下面的步骤即可</p>
<ol>
<li><p>根据1错误块得到错误发生在哪个组件以及具体发生在组件的哪个阶段</p>
</li>
<li><p>根据2错误块找到错误发生的调用栈位置  直接点击定位错误</p>
</li>
<li>根据错误信息提示在错误定位的地方修改即可</li>
</ol>
<h2 id="902">9.2. Vue框架规则类错误</h2>
<h3 id="810201">9.2.1. 报错: Vue is not defined</h3>
<p>错误提示: Vue没定义啊</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">&lt;body&gt;
  &lt;div id="app"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;script&gt;
  new Vue({
    el:'#app'
  })
&lt;/script&gt;
</code></pre>
<ul>
<li><p>报错图示:</p>
<p><img src="./index_files/报错4.png" alt="报错4"></p>
</li>
<li><p>分析</p>
</li>
</ul>
<pre><code class="lang-html">Vue全局变量哪里来的啊? 是不是引入vue.js才暴露在全局的啊, 就跟$变量也是引入jQuery.js才有的

所以证明你没有引入Vue.js
</code></pre>
<ul>
<li>解决:</li>
</ul>
<pre><code>去引入vue.js源码到你的页面中即可
</code></pre><h3 id="810202">9.2.2. 问题: 不解析内容</h3>
<p>错误描述: 运行后, 出现了双大括号, 不解析了</p>
<ul>
<li>报错提示</li>
</ul>
<p><img src="./index_files/报错2.png" alt="报错2"></p>
<ul>
<li>分析:</li>
</ul>
<pre><code class="lang-js">1. 先看看浏览器是否有报错 有报错提示根据提示解决问题
2. 可能把标签内容都写在了&lt;div id="app"&gt; &lt;/div&gt; 外面去了
</code></pre>
<ul>
<li>解决</li>
</ul>
<p>把内容都写到div#app里面来, 因为vue指定了以#app为根标签, 按照你写的模板结构, vue会创建一套虚拟DOM解析真正的内容和标签, 然后替换到这个标签上来, 写外面你让vue咋解析?</p>
<h3 id="810203">9.2.3. 报错: Do not mount Vue to &lt;html&gt;</h3>
<p>错误描述: 不能使用html或body作为vue的模板根标签</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;
&lt;!--错误！挂载到根元素--&gt;
&lt;body id="app"&gt;&lt;/body&gt;
&lt;script&gt;
    new Vue({
    el:'#app'
  })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/2.png" alt="01.png"></p>
<ul>
<li>分析</li>
</ul>
<pre><code class="lang-html">Vue框架不允许把html或者body作为挂载的根元素
</code></pre>
<ul>
<li>解决:</li>
</ul>
<blockquote>
<p>把挂载根元素换成普通元素即可</p>
</blockquote>
<pre><code>&lt;div id="app"&gt;&lt;/div&gt;
</code></pre><h3 id="810204">9.2.4. 报错: Property or method 'xxx' is not defined on the instance</h3>
<p>错误描述: 属性或方法没定义</p>
<p><img src="./index_files/3.png" alt="02.png"></p>
<ul>
<li>有问题代码: </li>
</ul>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;
&lt;div id="app"&gt;
  &lt;!--模板使用了name但是在实例选项中没有申明--&gt;
  {{name}}
&lt;/div&gt;

&lt;script&gt;
  const vm = new Vue({
    el: '#app',
    computed:{}
    data: {},
    methods: {}
  })
&lt;/script&gt;
</code></pre>
<ul>
<li>分析</li>
</ul>
<blockquote>
<p>在vue组件实例的模板中使用到的属性值或者方法必须要在实例的配置项中定义好才可以使用</p>
</blockquote>
<ul>
<li>解决</li>
</ul>
<blockquote>
<p>根据错误提示的内容，去组件实例选项中查看是否未定义该属性，查找范围包括data,computed,methods,props</p>
<p>在data: {} 里面定义name变量</p>
</blockquote>
<h3 id="810205">9.2.5. 报错: method 'name' has already been defined as a</h3>
<h3 id="810206">9.2.6. 报错: the data property 'name' is already defined</h3>
<p>错误描述: xxx already defined 就是已经定义过了的提示, 肯定重复定义了变量名哦</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">&lt;script&gt;
    const vm = new Vue({
        el: '#app',
        data: {
            name: 'cp'
        },
        props: {
            name: {
                type: String
            }
        },
        computed: {
            name() {}
        },
        methods: {
            name() {
                console.log(`cp`)
            }
        }
    })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/4.png" alt="03.png"></p>
<ul>
<li>分析</li>
</ul>
<blockquote>
<p>Vue框架不允许data/props/computed/methods中任意两项出现重复的属性名，在初始化配置时会进行名称检测</p>
</blockquote>
<ul>
<li>解决</li>
</ul>
<blockquote>
<p>根据错误提示找到哪里发生了重复，找到重复属性名更改为不重复即可</p>
</blockquote>
<h3 id="810207">9.2.7. 报错: Duplicate keys detected</h3>
<p>错误描述: 发现重复的key</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code>&lt;script src="./vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
  &lt;ul&gt;
    &lt;li v-for="item in list" :key="item.id"&gt;
      {{item.name}}
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;script&gt;
  const vm = new Vue({
    el: '#app',
    data: {
      // 这里有重复id
      list: [
        { id: 1, name: 'react' },
        { id: 2, name: 'vue' },
        { id: 1, name: 'angular' }
      ]
    }
  })
&lt;/script&gt;
</code></pre><ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/5.png" alt="1.png"></p>
<ul>
<li>分析</li>
</ul>
<blockquote>
<p>为保证列表的高效更新  vue框架在我们使用v-for指令的时候要求为每一项绑定一个唯一的key属性，注意key必须是唯一不可重复的  代码中的存在重复的id 所以会报错</p>
</blockquote>
<ul>
<li>解决</li>
</ul>
<blockquote>
<p>每次给key绑定值时确保是唯一的值</p>
</blockquote>
<pre><code>&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
  &lt;ul&gt;
    &lt;li v-for="item in list" :key="item.id"&gt;
      {{item.name}}
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;script&gt;
  const vm = new Vue({
    el: '#app',
    data: {
      // 这里有重复id
      list: [
        { id: 1, name: 'react' },
        { id: 2, name: 'vue' },
        { id: 3, name: 'angular' }
      ]
    }
  })
&lt;/script&gt;
</code></pre><h3 id="810208">9.2.8. 报错: the data option should be a function</h3>
<p>错误描述: 说你的data选项必须是一个方法</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;&lt;/div&gt;

&lt;script&gt;
Vue.component('add-component', {
    // 错误！！
    data: {
        name: 'cp'
    }
})
const vm = new Vue({
    el: '#app'
})
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/6.png" alt="04.png"></p>
<ul>
<li>分析</li>
</ul>
<blockquote>
<p>上面申明的组件add-component上面的data属性直接配置了一个对象，这在vue的组件系统中是不允许的，因为组件的核心使用场景是复用，data如果直接赋值一个对象，那么多个重复的组件会共用一套数据，一个组件进行数据更改所有组件都会受到影响，违背了组件的功能独立性</p>
</blockquote>
<ul>
<li>解决:</li>
</ul>
<blockquote>
<p>任何一个组件的data都应该申明为一个函数，函数中返回一个对象，这个全新的对象作为组件的依赖数据</p>
</blockquote>
<pre><code class="lang-js">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;&lt;/div&gt;

&lt;script&gt;
Vue.component('add-component', {
    // 正确
    data(){
        return {
            name:'cp'
        }
    }
})
const vm = new Vue({
    el: '#app'
})
&lt;/script&gt;
</code></pre>
<h3 id="810209">9.2.9. 报错: Component template should contain exactly one root element</h3>
<p>错误描述: 组件模板应该只包含一个根元素标签</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
    &lt;add-component&gt;&lt;/add-component&gt;
&lt;/div&gt;

&lt;script&gt;
    Vue.component('add-component', {
        template: `
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
`
    })

    new Vue({
        el: '#app'
    })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/7.png" alt="5.png"></p>
<ul>
<li><p>分析:</p>
<p>vue组件的的template选项中只能拥有一个根元素  原因是因为一是为了做组件样式隔离，二是为了渲染时存放当前的组件对应的vnode，所以只能有一个根元素  这在vue3.0中会得到改善</p>
</li>
<li><p>解决:</p>
</li>
</ul>
<blockquote>
<p>只写一个根元素</p>
</blockquote>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
    &lt;add-component&gt;&lt;/add-component&gt;
&lt;/div&gt;

&lt;script&gt;
    Vue.component('add-component', {
        template: `
&lt;div&gt;&lt;/div&gt;
`
    })

    new Vue({
        el: '#app'
    })
&lt;/script&gt;
</code></pre>
<h3 id="810210">9.2.10. 报错: do not use build-in or reserved HTML elements as</h3>
<p>错误描述: 不能将内置或保留的html元素用作组件</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;&lt;/div&gt;

&lt;script&gt;
  // 错误！！
  Vue.component('header', {
    data(){
      return {}
    }
  })
  const vm = new Vue({
    el: '#app'
  })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/8.png" alt="05.png"></p>
<ul>
<li>分析</li>
</ul>
<p>Vue框架对于组件的命名规则有一定限制，不允许和HTML内置标签发生名称重复，上面组件的名称header和HTML内置标签中的header标签重复，关于vue中的组件命名希望大家严格遵守 </p>
<ul>
<li>解决</li>
</ul>
<blockquote>
<p>将组件名称替换成规范的命名规则即可</p>
</blockquote>
<h3 id="810211">9.2.11. 报错: Unknown custom element</h3>
<p>错误描述: 不知道自定义的标签, 你注册了吗?</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
    &lt;father-component&gt;&lt;/father-component&gt;
&lt;/div&gt;

&lt;script&gt;
    Vue.component('father-component', {
        template:`
&lt;div&gt;
我是父组件
&lt;son-component&gt;&lt;/son-component&gt;
    &lt;/div&gt;
`
    })
    const vm = new Vue({
        el: '#app',
        components:{
            'son-component':{
                template:`
&lt;div&gt;我是子组件&lt;/div&gt;
`
            }
        }
    })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/9.png" alt="07.png"></p>
<ul>
<li><p>分析</p>
<p>组件 并没有在父组件 中注册，所以并不能正常使用，大家一定要记着，全局组件在每一个vue实例的模板中都能正常使用，而局部注册的组件只有在父组件的components选项中注册时候才能使用</p>
</li>
<li><p>解决</p>
</li>
</ul>
<blockquote>
<p>在父组件的components中注册一下组件即可</p>
</blockquote>
<pre><code>&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
  &lt;father-component&gt;&lt;/father-component&gt;
&lt;/div&gt;

&lt;script&gt;
  Vue.component('father-component', {
    template:`
      &lt;div&gt;
        我是父组件
        &lt;son-component&gt;&lt;/son-component&gt;
      &lt;/div&gt;
    `,
    // 注册局部组件！！！
    components:{
      'son-component':{
        template:`
          &lt;div&gt;我是子组件&lt;/div&gt;
        `
      }
    }
  })
  const vm = new Vue({
    el: '#app'
  })
&lt;/script&gt;
</code></pre><ul>
<li>总结: 谁用谁注册哦~全局的不用注册, 直接用</li>
</ul>
<h3 id="810212">9.2.12. 报错: Failed to mount component: template or render function not defined</h3>
<p>错误描述: 无法装载组件：未定义模板或呈现函数</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
    &lt;add-component&gt;&lt;/add-component&gt;
&lt;/div&gt;

&lt;script&gt;
    Vue.component('add-component', {
        data() {
            return {}
        }
    })
    new Vue({
        el: '#app'
    })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/10.png" alt="8.png"></p>
<ul>
<li><p>分析</p>
<p>尝试渲染组件，但是组件中既没有tempalte选项又没有render函数，因为vue组件的渲染最终是要执行render函数的，如果render函数存在就以render函数为准，如果render函数不存在，则会把template选项编译成为render函数再执行  所以这俩个需要申明其中的一个</p>
</li>
<li><p>解决</p>
</li>
</ul>
<blockquote>
<p>申明template选项或者申明render函数</p>
</blockquote>
<pre><code>&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;
&lt;script&gt;
  Vue.component('add-component', {
    template:`
     &lt;div&gt;this is add-component&lt;/div&gt;
    `,
    data() {
      return {}
    }
  })
  new Vue({
    el: '#app'
  })
&lt;/script&gt;
</code></pre><h3 id="810213">9.2.13. 报错: Avoid mutating a prop directly since the value will be overwritten</h3>
<p>错误描述: 避免直接改变属性，因为值将被覆盖</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">&lt;script src="./vue.js"&gt;&lt;/script&gt;
&lt;div id="app"&gt;
    &lt;add-component title="this is title"&gt;&lt;/add-component&gt;
&lt;/div&gt;
&lt;script&gt;
        Vue.component('add-component', {
        props: {
            title: {
                type: String
            }
        },
        template: `
&lt;div&gt;
{{title}}
&lt;button @click="change"&gt;修改数据&lt;/button&gt;
&lt;/div&gt;
`,
        methods:{
            change(){
                // 尝试直接修改父组件传过来的数据
                this.title = 'new title'
            }
        }
    })
new Vue({
    el: '#app'
})
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示:</li>
</ul>
<p><img src="./index_files/11.png" alt="9.png"></p>
<ul>
<li><p>分析:</p>
<p>上面的代码中，title数据来源于父组件，在子组件按钮点击时尝试直接修改title数据，基于vue单向数据流的要求，我们不能反向子组件直接修改父组件的数据  所以会报错</p>
</li>
<li><p>解决:</p>
</li>
</ul>
<blockquote>
<p>可以通过事件传递的方式，通过调用父组件的一个方法进行修改title数据，这样的话就符合父组件修改自己数据的要求，或者我们可以把props中的title赋值给子组件data中的一个新的值，让它成为子组件自己的数据，这样的话就可以子组件自己修改了</p>
</blockquote>
<pre><code class="lang-js">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
  &lt;add-component title="this is title"&gt;&lt;/add-component&gt;
&lt;/div&gt;

&lt;script&gt;
  Vue.component('add-component', {
    props: {
      title: {
        type: String
      }
    },
    data() {
      return {
        childTitle: this.title
      }
    },
    template: `
     &lt;div&gt;
      {{childTitle}}
      &lt;button @click="change"&gt;修改数据&lt;/button&gt;
     &lt;/div&gt;
    `,
    methods: {
      change() {
        this.childTitle = 'new title'
      }
    }
  })

  new Vue({
    el: '#app'
  })
&lt;/script&gt;
</code></pre>
<h3 id="810214">9.2.14. 报错: Computed property "xxx" was assigned to but it has no setter</h3>
<p>错误描述: 计算属性想被赋值, 但是它没有setter方法</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">&lt;div id="app"&gt;
&lt;input type="checkbox" v-model="isAll"&gt;
&lt;/div&gt;
&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;
&lt;script&gt;
    new Vue({
    el: "#app",
    computed: {
        isAll(){
            return true;
        }
    }
})
&lt;/script&gt;
</code></pre>
<ul>
<li><p>报错图示:</p>
<p><img src="./index_files/计算属性需要set和get.png" alt="计算属性需要set和get"></p>
</li>
<li><p>分析:</p>
<p>发现v-model会把标签的value值/状态值绑定给v-model指定的变量, 而变量又是给计算属性, 计算属性默认只返回值, 不是给它赋值</p>
</li>
<li><p>解决:</p>
<p>修改computed里的代码即可, 给计算属性一个set的机会, 但是千万不要在这里给计算 属性赋值, 会引起递归的</p>
</li>
</ul>
<pre><code class="lang-js">computed: {
    isAll: {
        set(val) { // 设置isAll的值的时候触发此方法, 传入要设置的值
            // val是全选框的true/false的值
            this.arr.map(obj =&gt; {
                obj['checked'] = val;
            })
        },
        get() {
            return this.arr.every(obj =&gt; obj['checked'] == true);
        }
    }
}
</code></pre>
<h3 id="810215">9.2.15. 报错: avoid using JavaScript unary operator as property name</h3>
<p>错误描述: 避免使用JavaScript一元运算符作为属性名</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">&lt;tr v-for="(obj, index) in list"&gt;
    &lt;td&gt;{{ obj.id }}&lt;/td&gt;
&lt;td&gt;{{ obj.name }}&lt;/td&gt;
&lt;td&gt;{{ obj.time }}&lt;/td&gt;
&lt;td&gt;
    &lt;button @click="delete(index)"&gt;删除&lt;/button&gt;
&lt;/td&gt;
&lt;/tr&gt;
</code></pre>
<ul>
<li><p>报错图示:</p>
<p><img src="./index_files/image-20210119200954791.png" alt="image-20210119200954791"></p>
</li>
<li><p>分析:</p>
</li>
</ul>
<pre><code class="lang-js">报错的意思是说你使用了一元运算符作为属性名, 而且报错里一直说delete有问题

后来百度一查发现delete是个关键字

所以以后不要用delete作为变量名/方法名哦
</code></pre>
<ul>
<li><p>解决:</p>
<p>把delete换个名字使用和定义即可</p>
</li>
</ul>
<pre><code class="lang-js">&lt;tr v-for="(obj, index) in list"&gt;
    &lt;td&gt;{{ obj.id }}&lt;/td&gt;
&lt;td&gt;{{ obj.name }}&lt;/td&gt;
&lt;td&gt;{{ obj.time }}&lt;/td&gt;
&lt;td&gt;
    &lt;button @click="delBtn(index)"&gt;删除&lt;/button&gt;
&lt;/td&gt;
&lt;/tr&gt;


methods: {
    delBtn(index){
        // 2. 给删除按钮绑定点击事件 - 传递过来对应绑定的index索引值
        // 删除数组里对应的元素, vue会自动更新页面
        this.list.splice(index, 1);
    }
}
</code></pre>
<h3 id="810216">9.2.16. 报错: Templates should only be responseible for mapping the state to the UI</h3>
<p>错误描述: 模板应该只负责将状态映射到UI</p>
<ul>
<li>有问题代码</li>
</ul>
<pre><code class="lang-js">&lt;body&gt;
    &lt;div id="app"&gt;
        &lt;ul&gt;
            &lt;li v-for="item in arr"&gt;{{item}}&lt;/li&gt;
        &lt;/ul&gt;

        &lt;!-- 2. 引入 vue.js--&gt;
        &lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            // 3. 实例化vue对象 (把视图配置进来让vue解析)
            new Vue({
                el: "#app", // 指向视图的名字(选择器/dom标签)
                data: { // vue世界用到的变量
                    arr: ["春天", "夏天", "秋天", "冬天"] // 变量名叫arr, 值是一个数组4个元素
                }
            })

        // 哇哦, 真香
        &lt;/script&gt;
    &lt;/div&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>
<ul>
<li><p>报错图示:</p>
<p><img src="./index_files/image-20210121230017265.png" alt="image-20210121230017265"></p>
</li>
<li><p>分析:</p>
</li>
</ul>
<pre><code class="lang-js">报错说只负责把状态更新到UI, 而且下面波浪线画的是script标签, 说明你script不是模板代码啊

Vue会把#app指定标签内的代码认为是模板代码, 怎么把script也认为了? 

看代码结构, 发现把script写#app标签里了我的天啊...
</code></pre>
<ul>
<li>解决: 把script标签等拿出来啊</li>
</ul>
<h2 id="903">9.3. 拼写类错误</h2>
<h3 id="810301">9.3.1. 报错: Error in mounted hook: "TypeError: xxx is not a function"</h3>
<p>错误描述: xxx不是一个方法</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-html">&lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;

&lt;div id="app"&gt;
&lt;/div&gt;
&lt;script&gt;
  const vm = new Vue({
    el: '#app',
    data: {
      name: "cp"
    },
    // 拼写类错误
    method:{
      add(){}
    },
    mounted(){
      this.add()
    }
  })
&lt;/script&gt;
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/12.png" alt="4.png"></p>
<ul>
<li>分析</li>
</ul>
<p>!&gt; 此类错误并不会直接告诉你是拼写错了，如果你发现貌似根据错误提示怎么找都找不到，那么试着检查下，vue的配置项是不是拼写错了</p>
<ul>
<li>解决: methods 配置项</li>
</ul>
<h2 id="904">9.4. 其他错误</h2>
<h3 id="810401">9.4.1. 报错: this.getOptions is not a function</h3>
<p>错误描述: this.getOptions不是一个方法</p>
<ul>
<li><p>代码环境: @vue/cli - 内部是webpack4.x版本,  而less-loader我们下的8.x版</p>
</li>
<li><p>报错图示:</p>
</li>
</ul>
<p><img src="./index_files/image-20210228221359031.png" alt="image-20210228221359031"></p>
<ul>
<li>分析</li>
</ul>
<p>这也不是我写的代码啊, 再根据别的提示说我less相关有问题, 去百度下蓝色指向的这句关键字吧</p>
<ul>
<li>解决</li>
</ul>
<p>百度上很多人遇到了, 让我下载less-loader除了8以外的版本</p>
<ul>
<li>具体为啥less-loader8.x版本就不行了呢? 因为webpack4.x配置引入less-loader方式 和less-loader8不同, 具体参考这个文档</li>
</ul>
<p><a href="https://segmentfault.com/a/1190000039190699">https://segmentfault.com/a/1190000039190699</a></p>
<h3 id="810402">9.4.2. 报错: this dependency was not found</h3>
<p>错误描述: 找不到此依赖项</p>
<ul>
<li>有问题代码:</li>
</ul>
<pre><code class="lang-js">import "@api/hmmm/questions"
</code></pre>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/image-20210228221103394.png" alt="image-20210228221103394"></p>
<ul>
<li>分析</li>
</ul>
<p>说找不到@api/hmmm/questions模块, 但是这是我们自己建立的, 为啥让我们下载, 应该是路径写错了导致未找到</p>
<ul>
<li>解决: </li>
</ul>
<p>@代表的是src文件夹, 你想访问src文件夹下的api文件夹, 正确写法 @/api</p>
<pre><code class="lang-js">import "@/api/hmmm/questions"
</code></pre>
<h3 id="810403">9.4.3. 报错: spawn cmd ENOENT</h3>
<p>错误描述: spawn命令无法运行</p>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/spawn.bmp" alt="spawn"></p>
<ul>
<li><p>分析</p>
<p>改端口号出现这个问题, 应该是电脑的命令未找到, 通过百度得知, 需要给环境变量配置system32下的命令</p>
</li>
<li><p>解决: </p>
<p>打开电脑的环境变量, 添加system32 或者你没有%SystemRoot%变量就换成这个填进去(最好挪到环境变量最上面) C:\Windows\System32</p>
</li>
</ul>
<p><img src="./index_files/image-20210319180104779.png" alt="image-20210319180104779"></p>
<h3 id="810404">9.4.4. 报错: Invalild options in vue.config.js</h3>
<p>错误描述: 在vue配置文件中非法的选项</p>
<ul>
<li>报错图示: </li>
</ul>
<p><img src="./index_files/vue配置错误.bmp" alt="vue配置错误"></p>
<ul>
<li><p>分析</p>
<p>看报错提示红色, 在vue.config.js中 devServe不被允许, 知道devServer才是正确的选项对吧?</p>
</li>
<li><p>解决: </p>
<p>把devServe  改成 devServer即可</p>
</li>
</ul>

          	</article>
        </div>
		</div>
  

<script type="text/javascript" src="./index_files/jquery-1.4.4.min.js.下载"></script>
<script type="text/javascript" src="./index_files/jquery.ztree.all-3.5.min.js.下载"></script>
<script type="text/javascript" src="./index_files/ztree_toc.js.下载"></script>
<script type="text/javascript" src="./index_files/toc_conf.js.下载"></script>

<script type="text/javascript">
<!--
$(document).ready(function(){
    var css_conf = eval(markdown_panel_style);
    $('#readme').css(css_conf)
    
    var conf = eval(jquery_ztree_toc_opts);
		$('#tree').ztree_toc(conf);
});
//-->
</script></body></html>